package org.keyuan.struts1.form.converter;

import org.apache.commons.beanutils.Converter;
import org.keyuan.entity.DeliverWay;

public class DeliverWayConverter implements Converter{

	@SuppressWarnings("unchecked")
	public Object convert(Class clazz, Object value) {
		if(clazz==String.class){
			return value.toString();
		}
		if(clazz==DeliverWay.class){
			try{
				DeliverWay.valueOf(value.toString());
			}catch(Exception e){
				e.printStackTrace();
			}
		}
		return null;
	}

}
